package com.spark.usermusicService.controller;


import com.spark.R;
import com.spark.usermusicService.entity.Music;
import com.spark.usermusicService.service.impl.MusicServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 音乐信息 前端控制器
 * </p>
 *
 * @author wzk
 * @since 2021-07-01
 */
@RestController
@RequestMapping("/usermusicService/music")
@CrossOrigin
public class MusicController {

    @Autowired
    private MusicServiceImpl musicService;

    @RequestMapping("/{id}")
    public R findMusicById(@PathVariable("id") String id) {
        Music music = musicService.getById(id);
        return R.ok().data("items", music);
    }

}

